import BaseModel from './baseModel'
import { get } from '../ajax/axios'
import { Api } from '../ajax/api'
import TimeStamp from 'time-stamp'

// 首页轮播图对象
class StudyTimeLineModel extends BaseModel {

  // 时间
  public date = ''
  // 内容
  public content = ''
  // 标题
  public title = ''

  get dateStr() {
    return TimeStamp('YYYY/MM/DD', new Date(this.date))
  }

  static async getModels() {
    const json = await get(Api.studyTimeLine.all) as any
    return this.modelsWithArr(json)
  }
}

export default StudyTimeLineModel
